1. Field of Invention
This invention relates generally to MPEG format video editing, and more particularly to a method and apparatus for playing an MPEG format video file backward.
2. Description of the Related Art
The term xe2x80x9cvideo editingxe2x80x9d is often used in two slightly different ways. Sometimes it refers to a process of selecting and re-recording just the good footage, eliminating the unwanted ones meanwhile the term is also used for the whole post-production process, including titling, special effects, reversing and etc. In the past, video editing requires expensive equipment and professional attainment in a high-budget production house. Nowadays, a video source often comes in a compressed digital format, which makes it possible for general users to perform video editing with relatively inexpensive personal computers.
Video sources are often in analog video formats including 8 mm, Hi-8, VHS, S-VHS and VHS C (a compact version of VHS). Video captured in analog format must be transferred into digital format and preferably compressed in order to be distributed, for example, over the Internet. Thus digital video editing, also called non-linear editing, uses many of the same principals used in a word processing in home computers, but with quite a few twists. For example, a general editing task may include a portion of one video being copied and inserted into another video or footage of animated graphics being added to enhance characterized subjects in another video. A special-effect editing task, however, requires editing applications or programs to be equipped with designated special effects, for example, slow motions, zoom in/out and etc. The end result is a video product that is much crisper, more to the point and much more comprehensive than was previously possible in regular video captures.
One of the special effect editing often required in many businesses wanting a professional look and quality in their promotional tapes, training tapes, and television commercials, is a reverse playback of an original footage. When the original footage is in analog format, video frames are consecutively arrayed and the reverse playback means to play the video frames backwards, one of the commonly seen features in a video cassette player. When the original footage is in compressed digital format, such as MPEG format, the video frames, however, are not consecutively arrayed and, as will be explained more below, the video frames in MPEG format are not the actual video frames that can be displayed on TV screens. The reverse playback of such MPEG compressed video frames is not simply to play the video frames backward as does in a video cassette player.
There are a few commercially available products in the market, which allows general users to play or edit the MPEG formatted video stream in their home personal computers, for example, XingMPEG Player, version 3.12 from Xing Technology Corporation in California, IfilmEdit, Ver 1.2.3 from Cinax Designs, Inc. in Canada and Video Clip MPEG from VITEC Multimedia Company in France. But none provides the utility of performing the reverse playback of an MPEG video footage and inserting the reversed footage into an editing video.
Similar to analog video editing, an MPEG video footage may be completely decoded and stored in a sequence of frame storage. The decoded video frames in the frame storage are then sequentially played backward. The approach, however, may only work for a very short footage. For a regular, even a couple of minutes footage, there would be a huge number of the frame storage to retain the sequence of decoded frames, which no desktop computers would be able to accommodate. There is thus a need for a generic solution for playing an MPEG format video file backward with the least amount of memory. Further, similar to the reverse playback in a video cassette player, the reverse playback of an MPEG format video file should be at a linear speed. Because each B frame in an MPEG format video file can be decompressed and displayed only when there are corresponding I and P frames available, the corresponding I and P frames would be thus displayed without being further decompressed. The reverse playback of the MPEG format video file may sometimes be at uneven frame rate, resulting in jittery visual effects. There thus a further need for a mechanism to distribute evenly the computations involved in displaying I, P and B frames without requiring additional memory such that the MPEG format video file could be played backward at a linear speed.
The present invention has been made in consideration of the above described problems and has particular applications to video special effect editing. According to one aspect of the present invention, the disclosed system includeds an MPEG decoder to decode an MPEG data file; a memory space including a first storage space, a second storage space and a third storage space. The first and the second storage spaces are respectively used to buffer a decompressed I and a decompressed P frame of a current data group. To minimize visual jitters, a processing time is allocated to decompress an I frame of a preceding data group, which is buffered in the third storage space before B frames of the current group are respectively decompressed in conjunction with the decompressed and buffered I and P frames of the current group.
Apart from all known methods, the process uses a minimum number of frame storage to buffer I frame and P frames while decoding B frames in a reverse order. Further to maintain a linear speed of the reverse play, as will be appreciated below, every frame is displayed after only one MPEG decoding process. A transitive frame from a previous GOP is decoded whenever the frames in the frame storage are retrieved for display. Thus the timing for each frame to be displayed is well controlled and the subsequent reverse playback will not have any jittery visual effects that are often resulted from traditional decoding processes prior to displaying a particular frame.
Accordingly, an important object of the present invention is to provide an method and apparatus for playing an MPEG data file backward with a linear speed and even decoding computation for each of the compressed frames. Other objects, together with the forgoing are attained in the exercise of the invention in the following description and resulting in the embodiment illustrated in the accompanying drawings.